import React, { PureComponent } from "react";
import { createPortal } from "react-dom";
import Modal from "./Modal";

export class App extends PureComponent {
  render() {
    return (
      <div className="app">
        <h1>H1</h1>
        {
          createPortal(
            <h2>H2</h2>,
            document.querySelector('#root1')
          )
        }
        <Modal>
          <div>标题</div>
          <div>内容</div>
        </Modal>
      </div>
    )
  }
}

export default App;
